<%@ page contentType="text/html; charset=UTF-8" %>
<%@page import="java.util.List"%>
<%@page import="java.util.Iterator"%>
<%@ page import="com.wlcorp.forcazamis.domain.system.Staff" %>
<%@ page import="com.wlcorp.forcazamis.sys.util.CommonUtil" %>
<%@ page import="com.wlcorp.forcazamis.sys.util.AppConstant" %>
<%
	List staffList = (List)request.getAttribute("staffList");
%>
<html>
<head>
	<title>员工列表</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta http-equiv="Pragma" content="no-cache"><meta http-equiv="Cache-Control" content="no-cache"><meta http-equiv="Expires" content="0">
	<link href="${pageContext.request.contextPath}/css/css.css" rel=stylesheet>
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/button_css.css" type="text/css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/form_css.css" type="text/css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/table_css.css" type="text/css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/pagetitle_css.css" type="text/css">
	<script language="javascript" src="${pageContext.request.contextPath}/script/common.js"></script>
	<script type="text/javascript">
    	function staffDetail(staffId){
    		parent.location = "${pageContext.request.contextPath}/system/staffManager.do?method=getStaff&staffId=" + staffId;
    	}
    	function deleteRecord(staffId){
    		if(confirm("确定删除？")){
    			window.location = "${pageContext.request.contextPath}/system/staffManager.do?method=deleteStaff&staffId=" + staffId;
    		}
    	}
    </script>
</head>
<body bgcolor="#ffffff">
  <center>
	<table width="90%" border="0" cellspacing="1" cellpadding="0" bgcolor="#999999">
          <tr bgcolor="#E7E7E7">
            <td class="bigtext" align="center" width="5%">序号</td>
            <td class="bigtext" align="center">姓名</td>
            <td class="bigtext" align="center">工号</td>
            <td class="bigtext" align="center">上司</td>
            <td class="bigtext" align="center">部门</td>
            <td class="bigtext" align="center">电话</td>
            <td class="bigtext" align="center">操作</td>
          </tr>
          <% 
          	int index = 0;
          	for(Iterator iter = staffList.iterator();iter.hasNext();){
          		Staff staff = (Staff)iter.next();
          		index++;
          %>
          <tr bgcolor="#ffffff" onmouseover="this.style.backgroundColor='#bbdffb';" onmouseout="this.style.backgroundColor='#ffffff'">
            <td align="center" class="td5px"><%=index%></td>
            <td class="td5px"><%=staff.getStaffName()%></td>
            <td class="td5px"><%=staff.getStaffCode()%></td>
            <td class="td5px"><%=staff.getManager() == null?"":staff.getManager().getStaffName()%></td>
            <td class="td5px"><%=staff.getDepartment() == null?"":staff.getDepartment().getDepartmentName()%></td>
            <td class="td5px"><%=CommonUtil.nullToStr(staff.getPhone())%></td>
            <td align="center" class="td5px"><a href="javascript:staffDetail('<%=staff.getStaffId()%>')">修改</a>&nbsp;
            <a href="javascript:deleteRecord('<%=staff.getStaffId()%>')">删除</a></td>
		  </tr>
          <%}%>
          <tr bgcolor="#ffffff" onmouseover="this.style.backgroundColor='#bbdffb';" onmouseout="this.style.backgroundColor='#ffffff'">
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td align="center" class="td5px"><a href="javascript:staffDetail('')">新增</a>&nbsp;</td>
          </tr>
	</table>
	<table><tr><td><%=request.getAttribute("pageURL")%></td></tr></table>
  </center>
  ${message}
</body>
</html>

